<template>
  <div class="">
    <h1>xiangqing</h1>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(item, index) in banner" :key="index">
        <img v-lazy="item.src" alt="" />
      </van-swipe-item>
    </van-swipe>

    <van-button type="primary" size="large" round @click="gotodesc"
      >图文介绍</van-button
    >
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: this.$route.query.id,
      banner: [],
    };
  },
  mounted() {
    this.getbanner();
  },
  methods: {
    getbanner() {
      this.$axios.get("/api/getthumimages/" + this.id).then((res) => {
        console.log(res);
        this.banner = res.data.message;
      });
    },
    gotodesc() {
      this.$router.push({ path: "/desc", query: { id: this.id } });
    },
  },
  components: {},
};
</script>

<style lang="scss"></style>
